package com.mall.bargain.mapper;

import com.mall.bargain.vo.VoBargain;
import com.mall.entity.TbBargain;
import com.mall.entity.TbItmeSpec;
import com.mall.entity.bargain.BgBargain;
import com.mall.bargain.vo.BargainVo;
import com.mall.entity.bargain.BgBargain;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: W
 * @date: 2021/07/20/20:08
 * Other: 砍价活动持久层
 */
@Mapper
public interface BargainMapper {

//    BargainVo findBargainById(Long bargainId);

    void updatePeopleNumById(BgBargain bargain);

    List<BgBargain> findList();

    BgBargain findOne(Long id);

    void updateStatus(@Param("id") Long id,@Param("status") int status);

    void UpdateOne(BgBargain bargain);

    BgBargain findByItemId(Long itemId);

    List<BgBargain> findAll();

    void updateStatusById(Long id);

    /**
     * 添加砍价商品表
     * @param bargain
     */
    void addBargain(VoBargain bargain);

    /**
     * 查询砍价商品表
     * @param bargain
     * @return List<VoBargain>
     */
    List<VoBargain> findBargainAll(@Param("bargain") VoBargain bargain);

    /**
     * 修改砍价商品表
     * @param bargain
     */
    void updateBargainById(TbBargain bargain);

    /**
     * 回显砍价商品表
     * @param id
     * @return TbBargain
     */
    TbBargain findBargainOne(Long id);

    /**
     * 添加商品轮播图表
     * @param bargain
     */
    void addCarousel(VoBargain bargain);

    /**
     * 逻辑删除商品表
     * @param id
     */
    void delBargainOne(Integer id);

    /**
     * 回显砍价属性表
     * @param goodsId
     * @return List<TbItmeSpec>
     */
    List<TbItmeSpec> findItemSpecAll(Long goodsId);

    /**
     * 回显砍价属性表
     * @param itemId
     * @return findItemSpecOne
     */
    TbItmeSpec findItemSpecOne(Long itemId);

    /**
     * 回显砍价属性表
     * @param bargain
     */
    void addBargainItem(VoBargain bargain);

    /**
     * 查询砍价属性表
     * @param i
     * @param id
     */
    void updateInventory(@Param("i") int i, @Param("id") Long id);

    void updateStatusByBargainId(@Param("id") Long id,@Param("status") String status);
}
